//package com.example.springai.controller;
//
//import org.springframework.ai.chat.client.ChatClient;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RestController;
//import reactor.core.publisher.Flux;
//
//@RestController
//public class ChatClientController {
//
//    @Autowired
//    private ChatClient chatClient;
//
//    @GetMapping("/ai")
//    String generation(String userInput) {
//        System.out.println("userInput = " + userInput);
//        String content = this.chatClient.prompt()
//                .user(userInput).call().content();
//        System.out.println("content = " + content);
////        chatClient.prompt().user("").call()
//        return content;
//    }
////
//    @GetMapping(value = "/streamAi", produces = "text/html;charset=UTF-8")
//    Flux<String> streamGeneration(String userInput) {
//        return chatClient.prompt().user(userInput).stream().content();
//    }
//
//}
